parted: fix compilation with GCC15
authorRosen Penev <[email protected]>
Thu, 14 Aug 2025 20:02:39 +0000 (13:02 -0700)
committerJosef Schlehofer <[email protected]>
Fri, 22 Aug 2025 13:17:20 +0000 (16:17 +0300)
Backport upstream patch.

Signed-off-by: Rosen Penev <[email protected]>
utils/parted/Makefile
utils/parted/patches/010-gcc15.patch [new file with mode: 0644]

index 988b2a35f5fab3ce879b06f12a3208b68978ddcd..d938854d894c58d511ce5cdc84f4653b38992727 100644 (file)
@@ -4,7 +4,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=parted
 PKG_VERSION:=3.6
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
 PKG_SOURCE_URL:=https://ftp.gnu.org/gnu/parted/
diff --git a/utils/parted/patches/010-gcc15.patch b/utils/parted/patches/010-gcc15.patch
new file mode 100644 (file)
index 0000000..80f10ed
--- /dev/null
@@ -0,0 +1,36 @@
+From 16343bda6ce0d41edf43f8dac368db3bbb63d271 Mon Sep 17 00:00:00 2001
+From: Rudi Heitbaum <[email protected]>
+Date: Wed, 20 Nov 2024 12:22:22 +0000
+Subject: [PATCH] bug#74444: [PATCH] parted: fix do_version declaration
+
+With gcc 15-20241117 compile fails with the below error, update the
+do_version declaration to match the header in command.h
+
+../../parted/parted.c: In function '_init_commands':
+../../parted/parted.c:2469:9: error: passing argument 2 of 'command_create' from incompatible pointer type [-Wincompatible-pointer-types]
+ 2469 |         do_version,
+      |         ^~~~~~~~~~
+      |         |
+      |         int (*)(void)
+In file included from ../../parted/parted.c:28:
+../../parted/command.h:35:39: note: expected 'int (*)(PedDevice **, PedDisk **)' {aka 'int (*)(struct _PedDevice **, struct _PedDisk **)'} but argument is of type 'int (*)(void)'
+   35 |                                 int (*method) (PedDevice** dev, PedDisk** diskp),
+      |                                 ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Signed-off-by: Rudi Heitbaum <[email protected]>
+Signed-off-by: Brian C. Lane <[email protected]>
+---
+ parted/parted.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/parted/parted.c
++++ b/parted/parted.c
+@@ -2172,7 +2172,7 @@ do_unit (PedDevice** dev, PedDisk** disk
+ }
+ static int
+-do_version ()
++do_version (PedDevice** dev, PedDisk** diskp)
+ {
+     printf ("\n%s\n%s",
+             prog_name,